import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

export default new Router({
    routes: [
        {
            path: '/',
            redirect: {
                path: '/index',
            }
        },
        {
            path: '/login',
            name: 'login',
            component: () => import('@/components/login')
        },
        {
            path: '/index',
            component: () => import('@/components/index'),
            children: [
                {
                    path: '',
                    component: () => import('@/components/videoList/index'),
                },
                {
                    path: 'newvideo',
                    component: () => import('@/components/newVideo'),
                },
                {
                    path: 'user',
                    component: () => import('@/components/user'),
                }, {

                    path: ':vid/video',
                    component: () => import('@/components/videos'),
                    props:true,
                },{

                    path: 'like',
                    component: () => import('@/components/videoList/like'),
                    props:true,
                },
            ]
        },]
})
